// index.ts
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'

// const routes: Array<RouteRecordRaw> = [...userInfo]

let routes: Array<RouteRecordRaw> = []
const modules = import.meta.glob('./modules/*.ts', { eager: true, import: 'default' })
for (const path in modules) {
  const mod:any = modules[path]
  routes = [...routes, ...mod]
}

const router = createRouter({
  history: createWebHistory(),
  // history: createWebHashHistory(),
  routes,
})

export default router
